home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / pascal / swag / printing.swg / 0029_Print Screen.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-01-27  |  1.1 KB  |  24 lines

  1. {
  2. > I find myself in need of a keyboard handler that traps and hides
  3. > the Print Screen key.  If this key is hit while in graphics mode
  4. > on a LaserJet it causes a line of garbage to print on a thousand
  5. > sheets of paper.... <more or less>.  I'd like to catch it and maybe
  6. > even point it to my own print procedure if possible.  If you can
  7. > dig something up, I'd be most grateful.  (TP6 if possible)
  8.  
  9. This is the traditional quick and dirty way to thwart PrintScreen:
  10.  
  11. mem[$0050:0000] := 1;
  12.  
  13. $0050:0000 is the PrintScreen status byte.  It is set to 1 while
  14. PrintScreen is in operation.  If the PrintScreen button is hit
  15. while the screen is already being printed, the print screen routine
  16. does nothing.  By setting the status byte to 1 yourself, you fool
  17. the PrintScreen routine into thinking the screen is already being
  18. printed and it will terminate without doing anything until you
  19. jiggle the status byte back to the "correct" setting.
  20.  
  21. Set the status byte back to 0 (mem[$0050:0000] := 0) at the end of
  22. your program so your users will be able to use PrintScreen after
  23. your program has terminated.
  24.